package org.chaiyi.template.core.common.contract.method;

import com.mongodb.client.result.DeleteResult;
import org.chaiyi.template.core.common.contract.Contractor;
import reactor.core.publisher.Mono;

import static org.chaiyi.template.core.common.contract.Contractor.Error.DELETE_METHOD_NOT_IMPLEMENTED;

public interface DeleteContractor<D> extends Contractor {


    /**
     * 删除前同步执行
     */
    default void deleteBefore(String tenantId, String buCode, String id){
    }


    default Mono<D> delete(String tenantId, String buCode, String id) {
        DELETE_METHOD_NOT_IMPLEMENTED.trigger();
        return null;
    }   
    
    /**
     * 删除后异步执行
     */
    default void  deleteAfter(String tenantId, String buCode, D entity) {
    }
}
